<template>
    <div>
        <div class="mask">
            <div class="login">
                <div class="user_img">
                    <img src="../../statics/imgs/userdefault.png" alt="">
                </div>
                <div class="login_info">
                    <div class="user_config clearfix">
                        <span class="glyphicon glyphicon-user fl"></span>
                        <input type="text" v-model="userName" class="fl">
                    </div>
                    <div class="user_config clearfix">
                        <span class="glyphicon glyphicon-search fl"></span>
                        <input class="fl" type="password" v-model="userPassword">
                    </div>
                     <router-link to="/home"> 
                        <button type="button" class="btn btn-primary btn-lg sign_in" @click="isLogin">登录</button>
                     </router-link> 
                </div>
            </div>
        </div>
    </div>
</template>
<script>

//导入common.js
import common from '../kits/common.js'

export default {
    data() {
        return {
            userName: "前端学院",
            userPassword: 123456
        }
    },
    methods: {
        isLogin(){
            // this.$http.post(
            //     common.domain+"/login",
            // {
            //     tc_name:this.userName,
            //     tc_pass:this.userPassword
            // },
            // {emulateJSON:true}
            // ).then(function(res){
            //     console.log(res)
            // })
        }
    }
}
</script>
<style scoped lang="less">
.mask {
    width: 100%;
    height: 100;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #2f4050;
    z-index: 999;
    .login {
        width: 500px;
        height: 350px;
        background-color: #fff;
        margin: 150px auto;
        position: relative;
        padding-top: 100px;
        .user_img {
            width: 140px;
            height: 140px;
            border: 1px solid #ddd;
            background-color: #fff;
            border-radius: 50%;
            position: absolute;
            top: 0;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            line-height: 138px;
            img {
                width: 120px;
                height: 120px;
                border-radius: 50%;
            }
        }
        .login_info {
            .user_config {
                width: 250px;
                height: 44px;
                margin: 0 auto 30px;
                span {
                    width: 44px;
                    height: 44px;
                    text-align: center;
                    line-height: 44px;
                    border: 1px solid #ccc;
                    margin-top: -1px;
                    border-radius: 5px 0 0 5px;
                }
                input {
                    padding: 10px 16px;
                    border-radius: 0 5px 5px 0;
                }
            }
            .sign_in {
                display: block;
                width: 250px;
                margin: 0 auto;
            }
        }
    }
}
</style>